package com.js.service.impl;


import com.js.mapper.TeacherMapper;
import com.js.pojo.Teacher;
import com.js.service.TeacherService;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
@Transactional
@Service("TeacherServiceImpl")
class TeacherServiceImpl implements TeacherService {
    private TeacherMapper teacherMapper;
    @Autowired
    public void setTeacherMapper(TeacherMapper teacherMapper) {
        this.teacherMapper = teacherMapper;
    }

    @Override
    public int addTeacher(Teacher teacher) {
        return teacherMapper.addTeacher(teacher);
    }

    @Override
    public int deleteTeacherById(int id) {
        return teacherMapper.deleteTeacherById(id);
    }

    @Override
    public int updateTeacher(Teacher teacher) {
        return teacherMapper.updateTeacher(teacher);
    }

    @Override
    public Teacher queryTeacherById(int id) {
        return teacherMapper.queryTeacherById(id);
    }

    @Override
    public Teacher queryTeacherByAccount(String account) {
        return teacherMapper.queryTeacherByAccount(account);
    }

    @Override
    public List<Teacher> queryAllTeacher() {
        return teacherMapper.queryAllTeacher();
    }

    @Override
    public List<Teacher> queryTeacherByName(String t) {
        return teacherMapper.queryTeacherByName(t);
    }
}
